import { createApp } from 'vue'
import App from './views/example/view/CartView.vue'
import router from './router'
import store from './store'

createApp(App).use(store).use(router).mount('#app')

// App.directive('lazyLoad', {
//     mounted(el) {
//         const loadImage = () => {
//             el.src = el.dataset.src
//         };
//         const handleScroll = () => {
//             const rect = el.getBoundingClientRect();
//             if (rect.top < window.innerHeight && rect.bottom > 0) {
//                 loadImage();
//                 window.removeEventListener('scroll', handleScroll);
//             }
//         };
//         window.addEventListener('scroll', handleScroll);
//         handleScroll();
//     }
// })

// App.directive('direct', {
//   mounted(el, binding) {
//     el.style.position = 'fixed'
//     const s = binding.arg || 'top'
//     el.style[s] = binding.value + 'px'
//   },
//   updated(el, binding) {
//     const s = binding.arg || 'top'
//     el.style[s] = binding.value + 'px'
//   }
// })
